package com.zhijian.medical.service;


import com.zhijian.medical.entity.po.AssessmentPaperPersonResult;
import com.zhijian.medical.entity.vo.request.AssessmentPaperPersonResultSearchVo;
import com.zhijian.medical.entity.vo.response.AssessmentPaperPersonResultVo;
import com.zhijian.medical.util.Page;

import java.util.List;

/**
 * 考核-试卷人员结果表 业务处理层
 *
 * @author HCG
 * @version 1.0
 * @date 2023-02-01 10:35:15
 */
public interface AssessmentPaperPersonResultService {

    /**
     * 主键查询
     *
     * @param id
     * @return
     */
    AssessmentPaperPersonResult selectById(Long id);

    /**
     * 主键查询vo
     *
     * @param id
     * @return
     */
    AssessmentPaperPersonResultVo selectVoById(Long id);

    /**
     * 按照主键删除
     *
     * @param id
     */
    void deleteById(Long id);

    /**
     * 根据试卷进行删除
     *
     * @param assessmentPaperId
     */
    void deleteByAssessmentPaperId(Long assessmentPaperId);

    /**
     * 根据考核id进行删除
     *
     * @param assessmentId
     */
    void deleteByAssessmentId(Long assessmentId);

    /**
     * 根据试卷进行删除
     *
     * @param assessmentPaperId
     * @param userId
     */
    void deleteByAssessmentPaperIdAndUserId(Long assessmentPaperId, Long userId);

    /**
     * 新增
     *
     * @param assessmentPaperPersonResult
     * @return
     */
    Long insert(AssessmentPaperPersonResult assessmentPaperPersonResult);

    /**
     * 更改
     *
     * @param assessmentPaperPersonResult
     * @return
     */
    boolean update(AssessmentPaperPersonResult assessmentPaperPersonResult);

    /**
     * 动态修改
     *
     * @param record
     * @return
     */
    boolean updateByPrimaryKeySelective(AssessmentPaperPersonResult record);

    /**
     * 总数
     *
     * @param assessmentPaperPersonResultSearchVo
     * @return
     */
    Integer count(AssessmentPaperPersonResultSearchVo assessmentPaperPersonResultSearchVo);

    /**
     * 列表
     *
     * @param assessmentPaperPersonResultSearchVo
     * @return
     */
    List<AssessmentPaperPersonResultVo> selectList(AssessmentPaperPersonResultSearchVo assessmentPaperPersonResultSearchVo);

    /**
     * 选择某个人的某道题目的那条数据
     *
     * @param assessmentPaperId
     * @param userId
     * @param questionId
     * @return
     */
    AssessmentPaperPersonResultVo selectByAssessmentPaperIdAndUserIdAndQuestionId(Long assessmentPaperId, Long userId, Long questionId);

    /**
     * 分页查询
     *
     * @param assessmentPaperPersonResultSearchVo
     * @return
     */
    Page<AssessmentPaperPersonResultVo> selectPage(AssessmentPaperPersonResultSearchVo assessmentPaperPersonResultSearchVo);

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities 实例对象列表
     * @return 影响行数
     */
    boolean insertBatch(List<AssessmentPaperPersonResult> entities);

    /**
     * 查询一个人在一个试卷中答对题目的数量
     *
     * @param assessmentPaperId
     * @param userId
     * @return
     */
    Integer selectRightCountByAssessmentPaperIdAndUserId(Long assessmentPaperId, Long userId);

    /**
     * 查询一个人在一个试卷中，单选题，答对题目的数量
     *
     * @param assessmentPaperId
     * @param userId
     * @return
     */
    Integer selectSingleRightCountByAssessmentPaperIdAndUserId(Long assessmentPaperId, Long userId);
}